<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>20_new关键字作用-构造函数当做构造函数来使用-函数中有方法</title>
    </head>
    <body>
        <script>
            function Person(name,age){
                console.log(this);
                this.name = name;
                this.age = age;
                this.eat = function(){
                    console.log('不知道');
                }
            }

            var p = new Person('马志强',70);
            console.log(p);
        </script>
    </body>
</html>